﻿using Ext.Net;
using Ext.Net.MVC;
using PcaCaja.BOL;
using PcaCaja.DAL;
using PcaCore.DAL.Log;
using PcaWeb.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace PcaWeb.Areas.Parqueos.Controllers
{
    public class LiquidacionUsuarioController : ControllerUser
    {
        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Registrar(string monedaId, decimal? monto)
        {
            try
            {
                PcaParqueos.DAL.dLiquidacion.Insert(dSesion.GetEmpresaId(),
                                                    dSesion.GetOficinaId(),
                                                    dSesion.GetUsuarioId(),
                                                    dSesion.GetId(),  
                                                    monedaId,
                                                    Convert.ToDecimal(monto));
                return Json(new { success = true });
            }
            catch (Exception ex)
            {
                return Json(new { success = false, msg = ex.Message });
            }
        }

        public ActionResult FrmNuevo()
        {
            return new Ext.Net.MVC.PartialViewResult
            {
                ViewName = "FrmNuevo"
            };
        }
    }
}